var financeObj;

function openYesOrNoDLG() {
	$('.zhezhao').css('display', 'block');
	$('#removeProv').fadeIn();
}

function cancleBtn() {
	$('.zhezhao').css('display', 'none');
	$('#removeProv').fadeOut();
}
function changeDLGContent(contentStr) {
	var p = $(".removeMain").find("p");
	p.html(contentStr);
}
$(function() {
	/*$(".viewFinance").on(
			"click",
			function() {
				// 将被绑定的元素（a）转换成jquery对象，可以使用jquery方法
				var obj = $(this);
				window.location.href = path + "/finance/viewfinance?empId="
						+ obj.attr("empId");
			});*/
/*
	$(".modifyFinance").on(
			"click",
			function() {
				var obj = $(this);
				window.location.href = path + "/finance/modifyfinance?empId="
						+ obj.attr("empId");
			});
*/
	$('#no').click(function() {
		cancleBtn();
	});

	$('#yes').click(
			function() {
				window.location.href = path + "/finance/delfinance?finid="
						+ financeObj.attr("finid");
			});

	$(".deleteFinance").on("click", function() {
		financeObj = $(this);
		changeDLGContent("你确定要删除员工为【" + financeObj.attr("empName") + "】吗？");
		openYesOrNoDLG();
	});

	/*
	 * $(".deleteProvider").on("click",function(){ var obj = $(this);
	 * if(confirm("你确定要删除供应商【"+obj.attr("proname")+"】吗？")){ $.ajax({ type:"GET",
	 * url:path+"/jsp/provider.do",
	 * data:{method:"delprovider",proid:obj.attr("proid")}, dataType:"json",
	 * success:function(data){ if(data.delResult == "true"){//删除成功：移除删除行
	 * alert("删除成功"); obj.parents("tr").remove(); }else if(data.delResult ==
	 * "false"){//删除失败 alert("对不起，删除供应商【"+obj.attr("proname")+"】失败"); }else
	 * if(data.delResult == "notexist"){
	 * alert("对不起，供应商【"+obj.attr("proname")+"】不存在"); }else{
	 * alert("对不起，该供应商【"+obj.attr("proname")+"】下有【"+data.delResult+"】条订单，不能删除"); } },
	 * error:function(data){ alert("对不起，删除失败"); } }); } });
	 */
});